#include <vector>
#include <unordered_map>
using namespace std;
/*
 * @lc app=leetcode.cn id=217 lang=cpp
 *
 * [217] 存在重复元素
 */

// @lc code=start
class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        unordered_map<int, int> mapper;
        for (int i = 0; i < nums.size(); i++) {
            mapper[nums[i]]++;
            if (mapper[nums[i]] >= 2) return true;
        }
        return false;
    }
};
// @lc code=end

